Why is my variable tabledata returning undefined